<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Render 函数</title>
  <script src="./vue-2.15.13.js"></script>
</head>
<body>
  <div id="app">
    <p>{{ price }}</p>
  </div>

  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        price: 100
      }
    })

    // 以下是手写的 render 函数
    function render () {
      with(this) {  //this 即 vm
        return _c(
          'div',
          {
            attrs: {'id': 'app'}
          },
          [
            _c('p', [_v(_s(price))])
          ]
        )
      }
    }
    //即：
    function render1 () {
      return vm._c(
        'div',
        {
          attrs: {'id': 'app'}
        },
        [
          vm._c('p', [vm._v(vm._s(vm.price))])
        ]
      )
    }
  </script>
</body>
</html>